<html lang="en" xmlns:th="http://www.thymeleaf.org">
<html>
<head>
    <meta charset="UTF-8">
    <title>一组通用后台权限管理</title>
    <script th:src="@{/js/jquery-1.10.2.js}"></script>
    <script th:src="@{/layui/layui.js}"></script>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">一组通用后台权限管理系统</div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img th:src="@{/img/dog.jpg}" class="layui-nav-img">
                    <span th:text="${loginName}"></span>
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="logout">注销</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <dl class="layui-nav-child">
                        <dd><a th:href="@{/news/toShowMain}"  th:text="首页"></a></dd>
                    </dl>
                </li>
                <li th:each="menu:${menus}" class="layui-nav-item layui-nav-itemed">
                      <a  class="" th:text="${menu.title}" href="javascript:;" ></a>
                    <dl class="layui-nav-child" th:each="child : ${menu.children}">
                        <dd><a th:href="${child.url}" th:text="${child.title}"></a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
    <div class="layui-body">
        <!-- 内容主体区域 -->
        <iframe id="iframMain" src="/news/toShowMain" style="width: 100%;height: 100%"></iframe>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © layui.com - 底部固定区域
    </div>
</div>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;
    });
        $(function () {
            //页面加载之后执行的代码
            //点击a标签的时候，修改iframe的src属性
            $("dd>a").click(function (e) {
                //阻断超链接的跳转事件
                e.preventDefault();
                //取得超链接对象的href属性值赋给iframe的src属性
                $("#iframMain").attr("src",$(this).attr("href"));
            })
        })
</script>
</body>
</html>